import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;

public class DictServer extends EchoServer{
    private HashMap<String,String> hashMap = new HashMap<>();
    public DictServer(int port) throws SocketException {
        super(port);
        hashMap.put("cat","小猫");
        hashMap.put("dog","小狗");
    }

    @Override
    public String process(String request) {
        return hashMap.getOrDefault(request,"查找的单词不存在");
    }

    public static void main(String[] args) throws IOException {
        DictServer dictServer = new DictServer(9090);
        dictServer. start();
    }
}
